import Vue from 'vue'
import App from './App.vue'
import Page from './views/Page'
import Classification from './views/Classification'
import Order from './views/Order'
import My from './views/My'
import Comic from './views/second/Comic'
import Happy from './views/second/Happy'
//1.导入vue-router
import VueRouter from 'vue-router'
//2.让vue去使用VueRouter
Vue.use(VueRouter)
//3.定义路由规则
const routes = [
{
  path:'/my',
  component:My
},
{
  path:'/page',
  component:Page
},
{
  path:'/Classification',
  component:Classification,
  children:[{
path:'comic',
component:Comic
  },
  {
    path:'happy',
component:Happy
  }
]
},
{
  path:'/Order',
  component:Order
},
]

//4.创建路由实例
const router = new VueRouter( {
  routes,
  // mode:'history'
})

Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
